//
//  ViewController.m
//  24-加密
//
//  Created by GivenBmli on 16/8/16.
//  Copyright © 2016年 GivenBmli. All rights reserved.
//

#import "ViewController.h"
#import "NSString+BML_MD5.h"
#import "NSString+BMLSHA_1.h"
#import "NSString+BMLBase64.h"
#import "NSString+BMLDES.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    NSString *afterMD5 = @"Hello";
//    MD5 SHA-1 单向散列函数,算法
//   MD5 - 验证运算 ,一般应用验证密码;
    NSString *final32BitLowerMD5 = [afterMD5 stingWith32BitMD5Lower];
    NSString *final32BitUpperMD5 = [afterMD5 stingWith32BitMD5Upper];
     NSString *final16BitLowerMD5 = [afterMD5 stingWith16BitMD5Lower];
     NSString *final16BitUpperMD5 = [afterMD5 stingWith16BitMD5Upper];
    
    NSLog(@"32bit小写:%@",final32BitLowerMD5);
    NSLog(@"32bit大写:%@",final32BitUpperMD5);
    NSLog(@"16bit小写:%@",final16BitLowerMD5);
    NSLog(@"16bit大写:%@",final16BitUpperMD5);
//    2.SHA_1
    NSString *afterSHA_1 = @"Hello";
    NSString *finalSHA_1 = [afterSHA_1 stringWithSHA_1 ];
    NSLog(@"%@",finalSHA_1);
//    3.Base64
    NSString *afterBase64 =@"Hello";
    [afterBase64 stringWithBase64];
    NSString *base64 = [afterBase64 stringWithBase64 ];
    NSLog(@"%@", base64);
    NSString *finalSting = [base64 base64WithString];
    NSLog(@"%@",finalSting);
//    4.对称密码:
//    三种算法 DES  三重DES AES
    NSString *sting = @"1234567890-";
    NSString *desSting = [sting stringWithDES];
    NSLog(@"desSting:%@",desSting);
    NSString *sourece =[desSting desWithSting];
    NSLog(@"%@",sourece);
//    机密
//    完整
//    认证
//    不可否认
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
